package com.keste.adf.ui.bean.common;

import com.keste.adf.ui.QuizPhaseListener;

import java.io.IOException;

import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;

import oracle.adf.controller.ControllerContext;
import oracle.adf.controller.v2.lifecycle.PagePhaseEvent;
import oracle.adf.controller.v2.lifecycle.PagePhaseListener;

public class MainPageBean extends QuizPhaseListener {
    public MainPageBean() {
        super();
    }
    
    @Override
    public void onPageLoad() {
        super.onPageLoad();
        
        super.getGlobalInfo().setInitilized(false);
        super.getGlobalInfo().initializeConnection();
        
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ExternalContext ectx = facesContext.getExternalContext();
        ControllerContext controllerCtx = null;
        controllerCtx = ControllerContext.getInstance();
        String activityURL = null;
        activityURL = "http://127.0.0.1:7101/kesteQuiz/faces/com/keste/adf/ui/pages/QuestionADay.jspx";
        
        try {
            ectx.redirect(activityURL);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

}
